library m_chatroom;

import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:flutter/material.dart';

import 'm_chatroom.dart';

export 'src/interface/room_page.dart';
export 'src/interface/root_proxy_model.dart';
export 'src/utils/room_dialog_utils.dart';
export 'src/template/program/program_list_page.dart';
export 'src/template/user_list/user_list_item_widget.dart';
export 'src/template/user_list/user_list_myselfitem_widget.dart';
export 'src/template/user_list/rank/page/room_rank_sub_page.dart';
export 'src/template/user_list/rank/page/true_love_rank_list_page.dart';
// export 'src/template/user_list/rank/model/api.dart';
export 'src/template/tools/room_tool_sheet.dart';
export 'src/socket/room_builder/item_builder/room_msg_item_builder.dart';

export 'src/template/mic_list/mic_seat_item_widget.dart';
export 'src/template/mic_list/mic_avatar.dart';
export 'src/template/mic_list/room_mic_widget.dart';
export 'src/template/mic_list/widget/mic_contribution_label.dart';
export 'src/hall/room_main/room_page_mixin.dart';
export 'src/hall/room_main/room_page_builder.dart';
export 'src/socket/room_cmd_handler.dart';
export 'src/template/tools/room_personal_data_page.dart';

export 'src/socket/room_builder/room_msg.dart';

/// 跳转到普通房间通用函数
/// context 上下文
/// channelId 房间id
/// hasPassword 是否有密码
/// isOwner 是否是房主
@Deprecated('Use RoomPage.show instead')
Future<void> jumpToHallPage(
  BuildContext context,
  String channelId,
  bool hasPassword,
  bool isOwner, {
  // JoinSource? joinSource,
  $fixnum.Int64? followUid,
}) async {
  await RoomPage.show(
    context,
    channelId,
    // joinSource: joinSource,
    followUid: followUid?.toInt(),
  );
}

/// channelId 房间id
/// context 上下文
/// type：1:体验兜风 2:陪伴师-车主配对 进入兜风房 3:陪伴师-派对派单
/// comId：与上面对应，这里保存的时对应的 id
@Deprecated('Use RoomPage.show instead')
Future<void> jumpToDoufengPage(
  String channelId,
  BuildContext context, {
  int? type,
  $fixnum.Int64? comId,
  // JoinSource? joinSource,
  $fixnum.Int64? followUid,
}) async {
  await RoomPage.show(
    context,
    channelId,
    // joinSource: joinSource,
    followUid: followUid?.toInt(),
  );
}

jumpMyRoomPage(BuildContext context) {
  // MyRoomPage.showWithBottomSheet(context);
}

showRoomCreatePage(BuildContext context) async {
  // RoomCreatePage.showWithBottomSheet(context);
  // showLoadingDialog();

  // // 判断自己当前是否有车
  // if (!(UserManager.instance.currentUser?.hasCar() ?? false)) {
  //   String tempStr = "";
  //   if (UserManager.instance.currentUser?.openedBlindBox ?? false) {
  //     tempStr = "驾驶座驾才可创建房间，您当前座驾已过期，是否立即获取新座驾？";
  //   } else {
  //     tempStr = "驾驶座驾才可创建房间，您当前未拥有座驾，是否立即获取？";
  //   }
  //
  //   RoomDialogUtils.showNoValidCarDialog(
  //       context: context, tittle: "获取座驾", tittle2: tempStr);
  //   return;
  // }

  // dismissLoadingDialog();
  // MyRoomPage.showWithBottomSheet(context);
}
